<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>把数字变成字符数组</title>
</head>
<body>
    <script>
        var name = prompt('请输入数字，它会自动把数组转换成数组')
        name = String(name);// 把数值型转换成字符型
        alert(name.split(''));// 输入空字符，使每个字符都分割
    </script>
</body>
</html>